package com.tg.demo.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.tg.demo.entity.Study;
import com.tg.demo.mapper.StudyMapper;
import com.tg.demo.service.StudyService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 用户信息表ServiceImpl
 *
 * @author yuanjin
 */
@Service
public class StudyServiceImpl implements StudyService {
    private static final Logger logger = LoggerFactory.getLogger(StudyServiceImpl.class);

    @Resource
    private StudyMapper studyMapper;


    @Override
    public List<Study> getListByCondition(Study study) {
        return studyMapper.getListByCondition(study);
    }

    @Override
    public PageInfo<Study> getListByPage(Study study, Integer page, Integer size) {
        PageHelper.startPage(page, size);
        List<Study> list = this.getListByCondition(study);
        return PageInfo.of(list);
    }
}
